package com.bwie.unit;

import org.springframework.amqp.core.Binding;
import org.springframework.amqp.core.BindingBuilder;
import org.springframework.amqp.core.FanoutExchange;
import org.springframework.amqp.core.Queue;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class Rabbit {

    @Bean
    public Queue addQueue(){
        return new Queue("addQueue",true);
    }

    @Bean
    public FanoutExchange directExchange(){
        return new FanoutExchange("directExchange",true,false);
    }

    @Bean
    public Binding binding(){
        return BindingBuilder.bind(addQueue()).to(directExchange());
    }

}
